home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Acorn RISC PD-CD 1
/
Acorn RISC PD-CD 1.iso
/
sillies
/
_yow
/
_help
next >
Wrap
Text File
|
1992-11-04
|
6KB
|
122 lines
!Yow displays a random "fortune cooky", quotation or witicism in a
window. The window closes when you click SELECT or MENU in it or re-run
!Yow. Clicking ADJUST displays a new fortune. If the desktop is not
running !Yow just prints a text to the current output stream(s).
This program is Copyright © 1992 Denis Howe and may be distributed freely
provided nothing is charged for it and this copyright notice is retained.
Comments, suggestions for improvements and new texts etc. are welcome.
Denis Howe <dbh@doc.ic.ac.uk> After all, all he did was string together
48 Anson Rd, London NW2 3UU a lot of old, well-known quotations.
+44 (81) 450 9448 - H L Mencken, on Shakespeare
History
-------
See !RunImage for details of modifications.
The name !Yow was used by Ian Rawlings <ssurawls@uk.ac.rdg.susssys1> for
his program which inspired this one (see below) but I have pretty much
completely rewritten it as well as greatly extending the data file
(YowLines). I got the Garfield icons from a program called !Quotation by
Roger Spooner, as well as some of the quotes. Ian's !Yow is available from
the Newcastle Info-Server <info-server@ncl.ac.uk> as "fortune" and
!Quotation is called "quote" there. Other texts come from Walther
Schoonenberg <walther@econ.vu.nl>'s program !Cooky ("dcookie" on
Newcastle), David K Barber (aka Nigelstache)
<Barber_DK@P1.lancsp.ac.uk>'s program Cookie (Newcastle "cookie"),
several versions of the Unix fortunes.dat file and a more recent file
full of jokes mailled to me by Ian.
Algorithm
---------
The program originally loaded the whole file into memory, picked a
random text by its number within the file and then searched through
memory for the Nth text. No wonder Ian thought he wanted a better
compiler, what he actually wanted was a better algorithm!
The program now sets the file pointer to a random byte offset within the
file and searches back from there for the start of a text (or the start
of the file). This is more likely to pick a long text than a short one
but this bias can be reduced by a tweak in !RunImage which is currently
commented out. A window is created in the middle of the screen and the
text is printed in it, breaking lines at spaces if necessary.
Sort & Gen programs
-------------------
Two other programs are included in the !Yow application directory.
"Sort" sorts the data file to make it easier to spot duplicates when
merging a new file of texts.
The second program, "Gen" is based on an idea from Scientific American.
It generates random sequences of characters based on the frequency of
occurence of strings of n characters in some example text (YowLines in
this case). The parameter "n" (Mem%) determines how many previous
output characters the program remembers in order to choose the next one.
If n=4 say, it searches YowLines randomly for an occurence of the last
three characters output, looks at the character following them in the
file, outputs it and shifts it onto it's memory FIFO (first-in
first-out) buffer. The effective value of "n" counts up from 1 (an
initial \0 output is assumed) on start-up. This process is equivalent
to using frequency tables for all sequences of "n" characters. That
would run much faster but would take a long time to calculate the
tables.
Ian's original documentation
----------------------------
Snail Mail Address:
Ian Rawlings
St. Lawrence,
Salisbury Road,
West Wellow,
Near Romsey,
HANTS S051 6AP
Tel (0794) 22086
EMAIL address: ssurawls@uk.ac.rdg.susssys1
This is an Archified version of YOW on the IBM. It is one of those
hateful Fortune cookie programs that simply plonk a phrase at random
onto the screen, the file of phrases in this case being taken from the
IBM side thru' PCdir. I don't know exactly who wrote the thing (apart
from the fact that they obviously don't lead a very interesting life if
they are prepared to sit down and write all that bumf) but the file from
the IBM had a header that I have stripped for simplicity of programming,
'cos I'm not too good yet! The header is included below for those
interested.
It's American, so many of the phrases are not funny to us, and some of
the phrases are obviously hilarious to the author but are totally lost
on me. Still, it does throw up some gems occasionally, eg "A Liberal
is somebody too poor to be a Capitalist and too rich to be a Communist"
Due to the gumf that goes on, not even Archie basic V could get a good
enough response time, so out of desperation I compiled it at a friends
house using RISC basic from Silicon Vision. After the heavy editing
necessary to get the program to compile I ended up with a 22K file from
an original of 2.6K, it needed 64K instead of 40K to run, and it also
needs the Floating Point Emulator loaded! It did run faster though,
which has never happened before when using RISC basic. Usually the
program runs slower! Could somebody PLEASE bring out a decent BASIC
compiler?!
My Bank Manager forced me to return my Memory Expansion to Diamond
Computing. I'd only had it for a week, but it really is missed!
The original header
-------------------
Zippy the pinhead data base. The official copy of this is in the file
"MLY;YOW >" on MC.MIT.EDU
Everything up to the first ascii \000 (`null') character is a comment.
The file consits of zippy quotations (from various comic books and
strips by Bill Griffith) followed by a null character.
Newline chracters following a quotation are ignored and are present
only for readability.
Have FUN!
This file is currently used by:
* the FORTUNE program on MIT-OZ
* the m-x yow command in GNU Emacs.
* NIL (MIT Common Lisp)'s debugger
* something bandy wrote at LLL-CRG.